﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Ch12.Models
{
    /// <summary>
    /// 缴费记录
    /// </summary>
    [Table("PaymentRecord")]
    public class PaymentRecord : EntitySet
    {
        [MaxLength(36)]
        public string BuildingId { get; set; }
        /// <summary>
        /// 缴费分户
        /// </summary>
        [Required]
        [MaxLength(36)]
        public string HouseId { get; set; }
        /// <summary>
        /// 缴费金额
        /// </summary>
        [DefaultValue(0)]
        public decimal Amount { get; set; }
        /// <summary>
        /// 交款人
        /// </summary>
        [Required]
        [MaxLength(36)]
        public string Payer { get; set; }
        /// <summary>
        /// 交款日期
        /// </summary>
        [Required]
        public DateTime? PaymentDate { get; set; }
        /// <summary>
        /// 缴费原因
        /// </summary>
        [MaxLength(256)]
        public string PaymentReason { get; set; }
        /// <summary>
        /// 收款人
        /// </summary>
        [Required]
        [MaxLength(36)]
        public string Operator { get; set; }
        /// <summary>
        /// 收据号
        /// </summary>
        [MaxLength(36)]
        public string ReceiptNumber { get; set; }
        /// <summary>
        /// 是否已打印收据
        /// </summary>
        [DefaultValue(false)]
        public bool IsPrintReceipt { get; set; }
        /// <summary>
        /// 是否已确认
        /// </summary>
        [DefaultValue(false)]
        public bool HasConfirmed { get; set; }

        public virtual House House { get; set; }
    }
}